# -*- coding: utf-8 -*-
from gevent import monkey
monkey.patch_all(Event=True,subprocess=True)
from gevent.pywsgi import WSGIServer
import werkzeug.serving
import os
from statistic import app
import sys
sys.path.append('..')
import setting

app.secret_key = os.urandom(24)

app.config['DEBUG'] = setting.app['debug']
app.config['SESSION_COOKIE_NAME'] = setting.app['name']
app.config['JSONIFY_PRETTYPRINT_REGULAR'] = setting.app['debug']

@werkzeug.serving.run_with_reloader
def main():
    server = WSGIServer(('', 8099), app, log=None, backlog=100000)
    server.serve_forever()

if __name__ == '__main__':
    main()
